package com.engine.budget.enums;

import java.util.HashMap;
import java.util.Map;

public enum VerifyMessage {

    SUCCESS("10000", "SUCCESS"),

    CKECKSUCCESS("10010", "数据仅检验成功"),

    CRCS_EMPTY("10001", "传入参数不能为空"),

    SAFE_ERR("10002", "安全校验参数未通过"),

    YSYE_BZ("10003", "预算余额不足"),

    YSZL_ERR("10004", "执行指令不存在"),

    MUST_EMPTY("10003", "接口必填参数不完整"),

    YWYZ_ERR("20001","参数验证失败"),

    UPDATE_ERR("20002", "数据入库失败"),

    XT_ERR("30001", "系统异常");




    private String errorCode;
    private String errorMessage;

    private VerifyMessage( String errorCode, String errorMessage) {
        this.errorCode = errorCode;
        this.errorMessage = errorMessage;
    }

    public VerifyMessage setErrorMessage(String errorMessage) {
        this.errorMessage = errorMessage;
        return this;
    }

    public String getErrorCode() {
        return errorCode;
    }

    public String getErrorMessagee() {
        return errorMessage;
    }

    public Map<String, Object> fromMap() {
        Map<String, Object> map = new HashMap();
        map.put("errorCode", errorCode);
        map.put("errorMessage", errorMessage);
        return map;
    }

    public  Map<String, Object> fromMap( Map<String, Object> map) {
        map.put("errorCode", errorCode);
        map.put("errorMessage", errorMessage);
        return map;
    }
}
